package edu.johnpank.libassistant

import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.context.event.ApplicationReadyEvent
import org.springframework.boot.runApplication
import org.springframework.context.annotation.Bean
import org.springframework.context.event.EventListener
import org.springframework.context.support.ResourceBundleMessageSource


@SpringBootApplication
class LibAssistantApplication

fun main(args: Array<String>) {
    runApplication<LibAssistantApplication>(*args)
}

@Bean
fun messageSource(): ResourceBundleMessageSource {
    val source = ResourceBundleMessageSource()
    source.setBasename("messages")
    source.setCacheSeconds(3600) // Refresh cache once per hour.
    return source
}